package com.song.mapper;

import com.song.dto.ShoppingCartDTO;
import com.song.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CartMapper {
    // 查询购物车中商品
    List<ShoppingCart> getCartCount(ShoppingCart shoppingCart);

    void updateCart(ShoppingCart shoppingCart);

    void insertCart(ShoppingCart shoppingCart);

    @Delete("delete from shopping_cart where user_id = #{userId}")
    void cleanCart(Long userId);


    void delCartOne(ShoppingCart shoppingCart);
}
